<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN"><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<title>API Functions</title>
<link rel="stylesheet" type="text/css" href="../../helpFiles/style.css">
</head>
<body><div align="center"><table class="allEncompassingTable"><tr><td>
<h1>GLTF Plugin API reference</h1>
<p class="infoBox">Plugin for glTF format support</p>
<h3 class="subsectionBar">
<a name="animationFrameCount" id="animationFrameCount"></a>simGLTF.animationFrameCount</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Return count of animation frames.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int count=simGLTF.animationFrameCount()<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>count</strong> (int): count of frames</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="clear" id="clear"></a>simGLTF.clear</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Clear all data stored in memory (geometry, material, animation, cache).</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simGLTF.clear()<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="exportAllObjects" id="exportAllObjects"></a>simGLTF.exportAllObjects</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export all objects to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simGLTF.exportAllObjects()<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="exportAnimation" id="exportAnimation"></a>simGLTF.exportAnimation</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export animation data to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simGLTF.exportAnimation()<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="exportObject" id="exportObject"></a>simGLTF.exportObject</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export object to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int nodeIndex=simGLTF.exportObject(int objectHandle)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>objectHandle</strong> (int): handle of the object</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>nodeIndex</strong> (int): index of the new node (may contain sub-nodes)</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="exportObjects" id="exportObjects"></a>simGLTF.exportObjects</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export objects to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simGLTF.exportObjects(table objectHandles)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>objectHandles</strong> (table of int): handles of the objects</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="exportSelectedObjects" id="exportSelectedObjects"></a>simGLTF.exportSelectedObjects</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export selected objects to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simGLTF.exportSelectedObjects()<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="exportShape" id="exportShape"></a>simGLTF.exportShape</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export shape to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int nodeIndex=simGLTF.exportShape(int shapeHandle, int parentHandle=-1, int parentNodeIndex=0)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>shapeHandle</strong> (int): handle of the shape</div>
<div>
<strong>parentHandle</strong> (int, default: -1): handle of the parent object. if specified the matrix of the node will be relative to this. use this in conjunction with parentNodeIndex parameter.</div>
<div>
<strong>parentNodeIndex</strong> (int, default: 0): index of parent node</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>nodeIndex</strong> (int): index of the new node (may contain sub-nodes)</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="loadASCII" id="loadASCII"></a>simGLTF.loadASCII</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Load an ASCII glTF model. The object must be destroyed later with .</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">bool result, string warnings, string errors=simGLTF.loadASCII(string filepath)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>filepath</strong> (string): </div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">
<div>
<strong>result</strong> (bool): true if success</div>
<div>
<strong>warnings</strong> (string): warning message(s)</div>
<div>
<strong>errors</strong> (string): error message(s)</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="loadBinary" id="loadBinary"></a>simGLTF.loadBinary</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Load a binary (.glb) glTF model. The object must be destroyed later with .</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">bool result, string warnings, string errors=simGLTF.loadBinary(string filepath)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>filepath</strong> (string): </div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">
<div>
<strong>result</strong> (bool): true if success</div>
<div>
<strong>warnings</strong> (string): warning message(s)</div>
<div>
<strong>errors</strong> (string): error message(s)</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="recordAnimation" id="recordAnimation"></a>simGLTF.recordAnimation</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export animation data to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simGLTF.recordAnimation(bool enable)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>enable</strong> (bool): if true the plugin will record the pose of all objects during simulation</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="saveASCII" id="saveASCII"></a>simGLTF.saveASCII</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Save a glTF model to an ASCII file.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">bool result=simGLTF.saveASCII(string filepath)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>filepath</strong> (string): </div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>result</strong> (bool): true if success</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="saveBinary" id="saveBinary"></a>simGLTF.saveBinary</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Save a glTF model to a binary file.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">bool result=simGLTF.saveBinary(string filepath)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>filepath</strong> (string): </div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>result</strong> (bool): true if success</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="serialize" id="serialize"></a>simGLTF.serialize</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Serialize glTF model to JSON string.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">string json=simGLTF.serialize()<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>json</strong> (string): the JSON document</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    See also
                                                </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br>
</td></tr></table></div></body>
</html>
